function clock() {
    var d=new Date();
    var sec=d.getSeconds();
    var min=d.getMinutes();
    var hour=d.getHours();
    if(sec<10) {
    	sec="0"+sec;
    }
    if(min<10) {
    	min="0"+min;
    }
    if(hour<10) {
    	hour="0"+hour;
    }
    
    var day=d.getDay();  
    var week;
    var arr_week;
    if($("#language").val()=='cn') {
    	arr_week=new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
    } else {
    	arr_week=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); 
    }
    week=arr_week[day];
    
    $("#clock").html(d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate()+" "+hour+":"+min+":"+sec+" "+week);
    
}

window.setInterval(clock,1000);